package cn.yanxiaohui.service.web.pattern.factory;

import cn.yanxiaohui.service.web.pattern.template.AliPay;
import cn.yanxiaohui.service.web.pattern.template.PayTemplate;
import cn.yanxiaohui.service.web.pattern.template.WeChatPay;

/**
 * @Description 工程模式
 * @Author： yanxh<br>
 * @Date 2019/12/9 13:29<br>
 * @Version 1.0<br>
 */
public class Factory {

    public static PayTemplate getPayTemplate(Integer type){
        PayTemplate result = null;
        if(type == 1){
            result = new AliPay();
        }else if(type == 2){
            result = new WeChatPay();
        }
        return result;
    }
}
